The present invention, generally, relates to coordination of tasks, and, more particularly, to systems, methods and computer program products for coordination of tasks in a computer environment.
Increases in the application of computers throughout many differing environments has led to a wide range of usage of computers and, more particularly, to the usage of computers supporting multi-tasking. While the various concurrently executing tasks in a multi-tasking environment may be operating independently without the need for any interaction, problems may arise in coordination where the various concurrently executing tasks need to interact in order to operate for their intended purpose. Furthermore, the coordination challenge may be increased where user interaction with the tasks during execution is required.
In an effort to reduce the complexity of applications having user input and present a more xe2x80x9cuser friendlyxe2x80x9d computing environment, graphic user interfaces (GUIs) have been developed. GUIs are believed to present an easier to understand interface to an application""s users and, thus, reduce the intimidation of an application. GUIs typically include multiple windows in which information is presented and user input obtained. Each of these windows may interact with one or more applications and may share data with one or more applications or other windows. However, development of these multiple window interfaces may be complex as interactions between the windows may be limited by the underlying application or by particular sequences of events which may be dictated by the windows.
An example of an application environment where multiple tasks may require interaction is where multiple users share data across a computer network. Such an environment may provide convenience in that it allows a central repository of data but may add further complications in managing this data as multiple users may desire to access such data simultaneously or concurrently. Thus, applications and, in particular, user interfaces for applications may have increased complexity associated with them to manage the interaction of users with a shared network resource, such as a database, to coordinate users"" interactions with the shared resource and maintain integrity of the shared resource.
Further problems may be created in a networked environment where user input may specify changes to a state of remote devices connected over a network. The problem of coordination of tasks may be complicated by introducing a plurality of unsynchronized systems, each of which may be a multi-tasking environment, which must be coordinated. Typically, coordination is provided by communications over a computer network, thereby introducing additional delay in the time between user input through, for example, a GUI, and updating of the state of individual multi-tasking environments. An example of such an environment is a distributed network management tool with tasks executing on various nodes of the computer network to be managed under the direction of a console node subject to user input to define test protocols for network management.
Accordingly, it is an object of the present invention to provide methods, systems and computer program products which may provide for coordination of operations between interrelated tasks in a multi-tasking environment.
It is a further object of the present invention to provide such methods, systems and computer program products which can process user inputs affecting the state of network resources and/or affecting the interaction between interrelated tasks.
These and other objects are provided by systems, methods and computer program products which coordinate operations for a plurality of interrelated tasks executing on a computer using actual state objects and desired state objects. For each event including coordination between two of the plurality of interrelated tasks, a first (or initiator) task initiates operations by a second (or executor) task to carry out a desired sequence of operations. The initiator task sets a desired state object to the desired state and submits a request to the executor task. The executor task, in turn, operates on the request in order to update an actual state object to the desired state stored in the desired state object by the initiator task. Write control over the desired state object is therefore granted to the initiator task while write control over the actual state object is granted to the executor task. The actual state object may represent a state of a remote device in which circumstance there may be a significant time delay between the point at which a request to change actual state is submitted and the time at which confirmation of the change is received. Therefore, a transitional state may be provided for the actual state object during the time period while the executor task is carrying out the operations necessary to change from the actual state to the desired state. Different restrictions on operations related to the associated object may be provided while the actual state object is in the transitional state.
Systems, methods and computer program products are also provided for monitoring a task executing on a computer which utilizes a work in process queue and a work pending queue. A watchdog task monitors an executing task to determine if any problems have been encountered and restarts the task if it is not executing properly. To allow clean restart, requests in the work in process queue are restarted from an initial start point. Alternatively, tasks from the work in process queue may be placed back in the work pending queue and the work in process queue is cleared after which execution of requests from the work pending queue are resumed.
In one embodiment of the present invention, a method is provided for coordination of operations for a plurality of interrelated tasks. A first one of the plurality of interrelated tasks sets a desired state object to a desired state and requests an update of an actual state object to the desired state. A second one of the plurality of interrelated tasks updates the actual state object responsive to the request to update the actual state object. The first one of the plurality of interrelated tasks has write access to the desired state object and does not have write access to the actual state object. The second one of the plurality of interrelated tasks has write access to the actual state object and does not have write access to the desired state object.
In another embodiment of the present invention, the desired state object and the actual state object each have an associated version number. Updating operations include receiving the request to update the actual state object to the desired state and reading the version number of the actual state object and the version number of the desired state object. The actual state object is set to the desired state if the version number of the actual state object is different from the version number of the desired state object. The version number of the actual state object is then set to the version number of the desired state object.
In a further embodiment of the present invention the second one of the plurality of interrelated tasks receives the request to update the actual state object to the desired state, reads the actual state object and the desired state object and sets the actual state object to the desired state. Setting operations for the actual state object may include setting the actual state object to a transitional state and then performing operations associated with changing from the actual state to the desired state. The actual state object is then set to the desired state. In one embodiment, operations for changing the actual state include communicating a request to change state to the desired state to a second device remote from the data processing system executing the first and second tasks. At least one of an error indication and a confirmation of state change is received from the second device. The actual state is set to the desired state if a confirmation of state change is received from the remote device.
In a further embodiment of the present invention, updates of an actual state object to the desired state are requested by placing a request in a work pending queue associated with the second one of the plurality of interrelated tasks.
In another embodiment of the present invention, a designation of a desired state of a first object is obtained from a first one of the plurality of interrelated tasks. A second one of the plurality of interrelated tasks is requested to update the first object to the desired state. The second one of the plurality of interrelated tasks updates the first object to the desired state responsive to the request to update the actual state. Updating operations include receiving the desired state, determining an actual state of the first object, and determining if the actual state is different from the desired state. The actual state is set to a transitional state if the actual state is different from the desired state. Operations associated with changing from the actual state to the desired state are then performed, after which the actual state is set to the desired state. The desired state may be selected from a plurality of possible desired states and the transitional state may be selected from a plurality of possible transitional states. The actual state is set to a selected one of the plurality of transitional states associated with an update from the actual state to the desired state.
In a further aspect of the present invention, methods are provided for monitoring a task executing on a data processing system, the task having an associated work in process queue and an associated work pending queue. The task is configured to properly execute requests which are terminated in progress and restarted from an initial start point. A watchdog task determines if the task is executing properly and restarts the task if it is not executing properly. Restarting is provided by placing requests in the work in process queue of the terminated task in the work pending queue and clearing the work in process queue. Execution by the task of requests from the work pending queue is then reinitiated.
While the present invention has been described primarily above with reference to method aspects, it is to be understood that systems and computer program products are also provided.